from appium import webdriver
import time

'''
@mobile1是配置信息，包括系统版本，模拟器或者真机的名称，要打开的app的包的名字，已经不清除数据
'''
mobile1 = {
  "platformName": "Android",
  'platformVersion': '7.1.2',
  "deviceName": "TSA-ANOO",
  "appPackage": "com.xingin.xhs",
  "appActivity": "com.xingin.xhs.index.v2.IndexActivityV2",
  "noReset": True,
  'automationName': 'UiAutomator2'
}

x = 1080
y = 2135
server = 'http://localhost:4723/wd/hub'
driver = webdriver.Remote(server, mobile1)
# driver = webdriver.Remote('https://127.0.0.1:4723/wb/hub',mobile1)
time.sleep(3)
size = driver.get_window_size()
width = size['width']
height = size['height']
# print(size)
start_x = width/2
start_y = height/8
end_x = width/2
end_y = height/2
time.sleep(3)
driver.swipe(start_x,start_y,end_x,end_y)
